import request from '../utils/request'
//获取文章详情
export function getDetails(id) {
    return request.request({
        method: "get",
        url: `/detail/${id}`
    })       
   }
   //获取所有文章
   export function getAllArticle(data) {
    return request.request({
        method: "get",
        url: `/getAllArticle?pageNum=&pageSize=`
    })       
   }
   //获取所有用户
   export function getAllUser() {
    return request.request({
        method: "get",
        url: `/getAllUser?pageNum=&pageSize=`
    })       
   }
   //获取所有待审核文章
   export function getPendingArticle() {
    return request.request({
        method: "get",
        url: `/getPendingArticle`
    })       
   }
   //审核文章
   export function reviewArticle(data) {
    return request.request({
        method: "get",
        url: `/reviewArticle/${data.articleId}/${data.state}`
    })       
   }
   //获取文章详情
   export function getArticleDetail(articleId) {
    return request.request({
        method: "get",
        url: `/detail/${articleId}`
    })       
   }
   //封禁用户
   export function ban(data) {
    return request.request({
        method: "get",
        url: `/ban/${data.userid}/${data.state}`
    })       
   }
   export function getArticleById(userid) {
    return request.request({
        method: "get",
        url: `/getArticleById/${userid}`
    })       
   }
   export function getUserInfo(userid) {
    return request.request({
        method: "get",
        url: `/getUserInfo/${userid}`
    })       
   }
   export function modifyUser(data) {
    return request.request({
        method: "post",
        url: `/modifyUser`,
        data
    })       
   }
   export function getWord(data) {
    return request.request({
        method: "get",
        url: `/getAllWords?word=${data.word}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
        data
    })       
   }
   export function getUserWords() {
    return request.request({
        method: "get",
        url: `/getUserWords`,

    })       
   }
   export function modifyWord(data,id) {
    return request.request({
        method: "post",
        url: `/updateWord/${id}`,
        data
    })       
   }
   export function searchData(data) {
    return request.request({
        method: "get",
        url: `/getWord/${data.id}`,
        data
    })       
   }

